<?php

use think\facade\Route;


// 首页路由

Route::get('/','index/index');


//会员路由

Route::group('user',function(){
    Route::get('/','member.user/index');
    Route::get('edit','member.user/edit');
    Route::get('option','member.user/option');
    Route::post('update','member.user/update');
    Route::get('grade','member.grade/index');
    Route::get('grade/create','member.grade/create');
    Route::post('grade/save','member.grade/save');
    Route::get('grade/edit','member.grade/edit');
    Route::post('grade/update','member.grade/update');
    Route::post('grade/switch','member.grade/switch');
    Route::get('grade/delete','member.grade/delete');

});

Route::group('payment',function(){
    Route::get('config/create','payment.config/create');
    Route::post('config/save','payment.config/save');
});


//上传路由

Route::group('upload',function(){
    Route::post('/','upload/index');
    Route::post('layedit','upload/layedit');
});

Route::group('login',function(){
    Route::get('/','login/form');
    Route::post('check','login/check');
});

// 管理员路由

Route::group('auth',function(){
    Route::get('/','auth.admin/index');
    Route::get('create','auth.admin/create');
    Route::get('me','auth.admin/me');
    Route::post('change','auth.admin/change');
    Route::post('save','auth.admin/save');
    Route::get('edit','auth.admin/edit');
    Route::post('update','auth.admin/update');
    Route::post('switch','auth.admin/switch');
    Route::get('delete','auth.admin/delete');
    Route::get('logout','auth.admin/logout');
    Route::get('role','auth.role/index');
    Route::get('role/create','auth.role/create');
    Route::post('role/save','auth.role/save');
    Route::get('role/edit','auth.role/edit');
    Route::get('role/permission','auth.role/permission');
    Route::post('role/allow','auth.role/allow');
    Route::post('role/update','auth.role/update');
    Route::post('role/switch','auth.role/switch');
    Route::get('role/delete','auth.role/delete');
});



//商品路由
Route::group('goods',function(){
    Route::get('/','goods.goods/index');
    Route::get('create','goods.goods/create');
    Route::get('option','goods.goods/option');
    Route::post('save','goods.goods/save');
    Route::get('edit','goods.goods/edit');
    Route::post('switch','goods.goods/switch');
    Route::post('update','goods.goods/update');
    Route::get('recycle','goods.goods/recycle');
    Route::get('restore','goods.goods/restore');
    Route::get('delete','goods.goods/delete');
    Route::get('tag','goods.tag/index');
    Route::get('tag/create','goods.tag/create');
    Route::post('tag/save','goods.tag/save');
    Route::get('tag/edit','goods.tag/edit');
    Route::post('tag/switch','goods.tag/switch');
    Route::post('tag/update','goods.tag/update');
    Route::get('tag/delete','goods.tag/delete');
    Route::get('category','goods.category/index');
    Route::get('category/create','goods.category/create');
    Route::post('category/save','goods.category/save');
    Route::get('category/child','goods.category/child');
    Route::get('category/edit','goods.category/edit');
    Route::post('category/switch','goods.category/switch');
    Route::post('category/home','goods.category/home');
    Route::post('category/update','goods.category/update');
    Route::get('category/delete','goods.category/delete');
});


Route::rule('banner','banner/banner','GET|POST');
Route::get('banner/delete','banner/delete');

// 内容管理
Route::group('article',function(){
    Route::get('/','content.article/index');
    Route::get('create','content.article/create');
    Route::post('save','content.article/save');
    Route::get('edit','content.article/edit');
    Route::post('switch','content.article/switch');
    Route::post('update','content.article/update');
    Route::get('delete','content.article/delete');
    Route::get('category','content.category/index');
    Route::get('category/create','content.category/create');
    Route::post('category/save','content.category/save');
    Route::get('category/edit','content.category/edit');
    Route::post('category/switch','content.category/switch');
    Route::post('category/update','content.category/update');
    Route::get('category/delete','content.category/delete');
});


/**
 * 拼团路由
 * */

Route::group('group',function(){

    /**
     * 拼团商品
     * */
    Route::get('goods','group.goods/index');
    Route::get('goods/create','group.goods/create');
    Route::get('goods/option','group.goods/option');
    Route::post('goods/save','group.goods/save');
    Route::get('goods/edit','group.goods/edit');
    Route::post('goods/update','group.goods/update');
    Route::post('goods/switch','group.goods/switch');
    Route::get('goods/delete','group.goods/delete');

    /**
     * 拼团活动商品路由
     * */
    Route::get('activity/goods','group.activity/goods');
    Route::get('activity/goods/delete','group.activity/deleteGoods');

    /**
     * 拼团活动
     * */
    Route::get('activity','group.activity/index');
    Route::get('activity/option','group.activity/option');
    Route::get('activity/create','group.activity/create');
    Route::post('activity/save','group.activity/save');
    Route::get('activity/edit','group.activity/edit');
    Route::post('activity/update','group.activity/update');
    Route::post('activity/switch','group.activity/switch');
    Route::get('activity/delete','group.activity/delete');

    /**
     * 拼团订单
     * */
    Route::get('order','group.order/index');
    Route::get('order/read','group.order/read');
    Route::get('order/refund','group.order/refund');
});


Route::group('order',function (){
    Route::get('/','order.order/index');
    Route::get('delivery','order.order/delivery');
    Route::get('receipt','order.order/receipt');
    Route::get('pay','order.order/pay');
    Route::get('finish','order.order/finish');
    Route::get('cancel','order.order/cancel');
    Route::get('after','order.order/after');
    Route::get('read','order.order/read');
    Route::get('refund','order.order/refund');
});



// 营销管理
Route::group('market',function(){
    /**
     * 优惠券路由
     * */
    Route::get('coupon','market.coupon/index');
    Route::get('coupon/create','market.coupon/create');
    Route::post('coupon/save','market.coupon/save');
    Route::get('coupon/option','market.coupon/option');
    Route::get('coupon/edit','market.coupon/edit');
    Route::post('coupon/update','market.coupon/update');
    Route::get('coupon/delete','market.coupon/delete');
    /**
     * 任务路由
     * */
    Route::get('task','market.task/index');
    Route::get('task/create','market.task/create');
    Route::post('task/save','market.task/save');
    Route::get('task/edit','market.task/edit');
    Route::post('task/update','market.task/update');
    Route::get('task/delete','market.task/delete');

    /**
     * 积分设置
     * */
    Route::rule('integral/setting','market.integral/setting','get|post');

    /**
     * 会员套餐
     * */

    Route::get('combo','market.combo/index');
    Route::get('combo/create','market.combo/create');
    Route::get('combo/coupon','market.combo/coupon');
    Route::get('combo/edit','market.combo/edit');
    Route::post('combo/update','market.combo/update');
    Route::post('combo/save','market.combo/save');
    Route::get('combo/delete','market.combo/delete');

});

/**
 * 系统设置
 * */
Route::group('setting',function (){
    /**
     * 轮播设置
     * */
    Route::rule('banner','setting.banner/index','get|post');
    Route::get('banner/delete','setting.banner/delete');

    /**
     * 支付配置
     * */

    Route::rule('payment','setting.payment/index','get|post');
    Route::post('payment/save','setting.payment/save');
});



// 积分商城路由
Route::group('integral',function(){
    Route::get('goods/interval','integral.interval/index');
    Route::get('goods/interval/create','integral.interval/create');
    Route::get('goods/interval/edit','integral.interval/edit');
    Route::post('goods/interval/save','integral.interval/save');
    Route::post('goods/interval/switch','integral.interval/switch');
    Route::post('goods/interval/update','integral.interval/update');
    Route::get('goods/interval/delete','integral.interval/delete');
    Route::get('goods','integral.goods/index');
    Route::get('goods/create','integral.goods/create');
    Route::post('goods/save','integral.goods/save');
    Route::get('goods/edit','integral.goods/edit');
    Route::post('goods/update','integral.goods/update');
    Route::post('goods/switch','integral.goods/switch');
    Route::get('goods/delete','integral.goods/delete');
});


// 秒杀路由组

Route::group('spike',function(){
    Route::get('goods','spike.goods/index');
    Route::get('goods/create','spike.goods/create');
    Route::get('goods/option','spike.goods/option');
    Route::post('goods/save','spike.goods/save');
    Route::get('goods/edit','spike.goods/edit');
    Route::post('goods/update','spike.goods/update');
    Route::post('goods/switch','spike.goods/switch');
    Route::get('goods/delete','spike.goods/delete');
    Route::get('meeting','spike.meeting/index');
    Route::get('session','spike.session/index');
    Route::get('session/goods','spike.session/goods');
    Route::post('session/goods/save','spike.session/saveGoods');
    Route::get('session/delete','spike.session/delete');
    Route::get('session/goods/delete','spike.session/deleteGoods');
    Route::get('meeting/create','spike.meeting/create');
    Route::get('meeting/copy','spike.meeting/copy');
    Route::get('meeting/option','spike.meeting/option');
    Route::post('meeting/save','spike.meeting/save');
    Route::get('meeting/edit','spike.meeting/edit');
    Route::post('meeting/update','spike.meeting/update');
    Route::post('meeting/switch','spike.meeting/switch');
    Route::get('meeting/delete','spike.meeting/delete');
});